package com.coderly.onlinegallerysharingplatform.common.convention.errorcode;

import lombok.Getter;

/**
 * 异常码
 */
@Getter
public enum ErrorCode implements IErrorCode {

    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    VERIFICATION_CODE_ERROR(40102, "验证码错误"),
    VERIFICATION_CODE_SEND_FREQUENTLY(40103, "请求太频繁，请60秒钟后再试"),
    LOGIN_TYPE_ERROR(40104, "登录类型错误"),
    USER_NOT_FOUND(40105, "该用户不存在"),
    PHONE_OR_PASSWORD_ERROR(40106, "手机号或密码错误"),
    USER_HAS_LOGGED(40107, "用户已经登录，请勿重复登录"),
    PHONE_HAS_BOUND(40108, "手机号已被绑定"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),

    OPERATION_ERROR(50001, "操作失败"),


    CANT_FOLLOW_YOUR_SELF(20001, "无法关注自己"),
    FOLLOW_USER_NOT_EXISTED(20002, "关注的用户不存在"),
    FOLLOWING_COUNT_LIMIT(20003, "您关注的用户已达上限，请先取关部分用户"),
    ALREADY_FOLLOWED(20004, "您已经关注了该用户"),
    CANT_UNFOLLOW_YOUR_SELF(20005,"无法取管自己" ),
    UNFOLLOW_USER_NOT_EXISTED(20006, "取关用户不存在" ),
    NOT_FOLLOW_YET(20007, "未曾关注该用户");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
